package com.lagou.demo.controller;

import com.lagou.demo.service.DemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Auther: whh
 * @Date: 2021/4/6 0006
 * @Description:
 */
@LagouController
@LagouRequestMapping("/typedemo")
@Security({"zhangsan","lisi"})
public class TypeTestController {

    @LagouAutowired
    private DemoService demoService;

    /***
     * @Desc: url:/demo/query
     * @param request
     * @param response
     * @param name
     * @return {@link String}
     * @author wonder
     * @date 2021/3/31 0031
     */
    @LagouRequestMapping("/handle01")
    @Security("lisi")
    public String handle01(HttpServletRequest request, HttpServletResponse response, String username){
        return demoService.get(username);
    }

    @LagouRequestMapping("/handle02")
    @Security({"zhangsan"})
    public String handle02(HttpServletRequest request, HttpServletResponse response, String username){
        return demoService.get(username);
    }

}
